<!DOCTYPE html>
<html lang="en">
<head>
[#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/user.css?v=3" rel="stylesheet" type="text/css"/>
    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script class="resources library" src="/resources/js/area.js" type="text/javascript"></script>
    <style type="text/css">
        option {
            font-size: 14px;
            line-height: 20px;
        }
    </style>

[#import "/customer/include/pagination.ftl" as p/]
</head>

<body>
<!--头部-->
[#include "/customer/include/header.ftl"]
<style>
    <style>
    .btnRed_F_small {
        width: 80px;
        height: 36px;
        line-height: 34px;
        overflow: hidden;
        display: block;
        margin: 0 auto;
        color: #fff;
        font-size: 16px;
        text-align: center;
        cursor: pointer;
        outline: none;
        background-color: #F3485A;

    }

    td {
        border: #c0c9d5 1px solid !important;;
    }

    tr {
        border: #c0c9d5 1px solid !important;
    }

    th {
        border: #c0c9d5 1px solid !important;;
    }

    .alert {
        padding: 8px 35px 8px 14px;
        margin-bottom: 20px;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
        background-color: #fcf8e3;
        border: 1px solid #fbeed5;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        border-radius: 4px
    }

    .alert .close {
        position: relative;
        top: -2px;
        right: -21px;
        line-height: 20px
    }

    .alert-info {
        color: #861E03;
        background: none repeat scroll 0% 0% #FFDFA2;
        border-color: #FFDFA2;
    }

    .close {
        float: right;
        font-size: 20px;
        font-weight: bold;
        line-height: 20px;
        color: #000;
        text-shadow: 0 1px 0 #fff;
        opacity: .2;
        filter: alpha(opacity=20)
    }

    .close:hover, .close:focus {
        color: #000;
        text-decoration: none;
        cursor: pointer;
        opacity: .4;
        filter: alpha(opacity=40)
    }

    .layer-input {height:38px;line-height:38px;line-height:36px\9;border:1px solid #e6e6e6;background-color:#fff;border-radius:2px;width: 75%}

</style>


</style>

<div class="member">
    <!--左边-->
[#include "/customer/include/member_left_menu.ftl"]
<script>
        function closeTips(e) {
    $(".alert").hide(300);
}


</script>
  <script>
  layui.use(['form','layer'], function(){
    var form = layui.form(), $=layui.jquery, layer = layui.layer;});
function opens(){
if(confirm("确定开通活期宝账户吗")){
$.post('/member/current/open',
{

},function(returnedData,status){
layer.msg("开通成功",function(){
    location.reload();

});

//                            if(returnedData.code == 0){
//                                $.dialog({
//                                    title:'温馨提示',
//                                    lock: true,
//                                    background: '#000', /* 背景色 */
//                                    opacity: 0.5,       /* 透明度 */
//                                    content: "<h4>"+returnedData.message+"</h4>",
//                                    icon: 'success.gif',
//                                    ok:  function () {
//                                        location.href = "/user/current/account";
//                                    }
//                                });
//                            }else{
//                                $.dialog({
//                                    title:'温馨提示',
//                                    lock: true,
//                                    background: '#000', /* 背景色 */
//                                    opacity: 0.5,       /* 透明度 */
//                                    content: "<h4>"+returnedData.message+"</h4>",
//                                    icon: 'error.gif',
//                                    cancel: true
//                                });
//                            }
});
}
}



</script>
    <!--左边 end-->
    <div class="memberRight">
        <div class="member_tab">
            <div class="member_tab">
                <a href="/member/current/index">活期宝</a>
                <a  [#if turnType=='into' ]
        class="on"
            [/#if]
              href="${path}/member/current/to/into">活期宝购买</a>
                <a   [#if turnType=='out' ]
                        class="on"
                [/#if] href="${path}/member/current/to/out">活期宝撤购</a>
            </div>
        </div>
        <form class="layui-form">
<div class="alert alert-info"><a class="close" onclick="closeTips()" data-dismiss="alert">×</a>
  <p>活期宝购买后 当日会产生日化收益</p></div>
[#if status==0]
   <div class="b-text">你还未开通活期宝账户，请先<a class="fred" href="javascript:void(0)" onclick="opens()" target="_blank">开通活期宝账户</a>。</div>
 [/#if]
[#if status==1]
     <div class="b-data" style="padding:20px">
        <div class="member_tab_info">

            <table class="layui-table">
                <tbody>

                <tr>
                    <td>可用余额：</td>
                    <td>
                        ￥${account.balance}
                    </td>
                </tr>

                <tr>
                    <td>活期宝总额：</td>
                    <td> ￥${yuEbao.total}</td>
                </tr>
                <tr>
                    <td>[#if turnType=='into' ]转入金额[#else]转出金额[/#if]:</td>
                    <td>
                        <input type="text" lay-verify="required" name="money" id="money" autocomplete="off" class="inp-jine layui-input"
                               onkeyup="value=value.replace(/[^\d.]/g,'')"  />
                    </td>
                </tr>



                </tbody>

            </table>
            <div class="span10">
            [#if turnType=='into' ]
                <button lay-submit lay-filter="MainForm" class="layui-btn" style="background-color: #F3485A;">确 认 购 买</button>
            [#else]
                <button lay-submit lay-filter="MainForm" class="layui-btn" style="background-color: #F3485A;">确 认 撤 购</button>
            [/#if]
            </div>
        </div>
                        </div>

            </form>

    </div>
[/#if]
</div>

<script>
    layui.use(['form','layer'], function(){
        var form = layui.form(), $=layui.jquery, layer = layui.layer;
        form.on('submit(MainForm)', function(data){
            var index = layer.load();
            ajax({
                url:"${path}/member/current/inout/${turnType}",
                data: data.field,
                success: function(result){
                    layer.close(index);
                    if(result && result.type=="success"){
                        layer.msg(result.content,function(){
                            location.reload();
                        });
                    }else{
                        layer.msg(result.content,{icon:2});
                        $("#randImage").click();
                    }
                },
                complete:function(){
                    layer.close(index);
                }
            });
            return false;
        });
    });

</script>
  <script>
  layui.use(['form','layer'], function(){
    var form = layui.form(), $=layui.jquery, layer = layui.layer;});
function opens(){
if(confirm("确定开通活期宝账户吗")){
$.post('/member/current/open',
{

},function(returnedData,status){
layer.msg("开通成功",function(){
    location.reload();

});


});
}
}



</script>
[#include "/customer/include/footer.ftl"]
</body>
</html>
